Function of random variable